package clubhouse.antislam;

/**
 * @author Anis Darwich & Lionel Croix - Simulation and experimentation on Robot in WSN - WnSN Lab - SJTU
 */
public class AntiSlamNode {
	
	/**Id of current node.*/
	private double nodeId;
	/**X coordinate of current node.*/
	private double x;
	/**Y coordinate of current node.*/
	private double y;
	/**Current distance between robot and current node.*/
	private double dist;
	/**Angle between robot and current node*/
	private double angle;
	/**Current angle deviation of current node.*/
	private double deviation;
	
	/**
	 * Constructs the AntiSlamNode object by using specified node information and put the other information at the 
	 * initial value.
	 * @param addNode the node to convert to an Anti-SLAM Node.
	 */
	public AntiSlamNode(double[] addNode){
		this.nodeId = addNode[0];
		this.x = addNode[1];
		this.y = addNode[2];
		this.dist = AntiSLAM.INITVALUE;
		this.angle = AntiSLAM.INITVALUE;
		this.deviation = AntiSLAM.INITVALUE;
	}

	/**
	 * Get the X coordinate of the current Anti-SLAM Node.
	 * @return the value of the X coordinate the current Anti-SLAM Node.
	 */
	public double getX(){
		return this.x;
	}
	
	/**
	 * Get the Y coordinate of the current Anti-SLAM Node.
	 * @return the value of the Y coordinate the current Anti-SLAM Node.
	 */
	public double getY(){
		return this.y;
	}
	
	/**
	 * Get the id of the current Anti-SLAM Node.
	 * @return the value of the id the current Anti-SLAM Node.
	 */
	public double getNodeId(){
		return this.nodeId;
	}
	
	/**
	 * Set the new distance between robot and current Anti-SLAM node.
	 * @param newDist the new value of distance to set.
	 */
	public void setDist(double newDist){
		this.dist = newDist;
	}
	
	/**
	 * Get the distance between robot and current Anti-SLAM node.
	 * @return the value distance between robot and current Anti-SLAM node.
	 */
	public double getDist(){
		return(this.dist);
	}

	/**
	 * Set the new angle between robot and current Anti-SLAM node.
	 * @param angle the new value of angle to set.
	 */
	public void setAngle(double angle) {
		this.angle = angle;
	}
	
	/**
	 * Get the angle between robot and current Anti-SLAM node.
	 * @return the value angle between robot and current Anti-SLAM node.
	 */
	public double getAngle(){
		return(this.angle);
	}
	
	/**
	 * Set the new deviation angle of the current Anti-SLAM node.
	 * @param deviation the new deviation angle to set.
	 */
	public void setDeviation(double deviation) {
		this.deviation = deviation;
	}
	
	/**
	 * Get the deviation angle of the current Anti-SLAM node.
	 * @return the value deviation angle of the current Anti-SLAM node.
	 */
	public double getDeviation() {
		return this.deviation;
	}

	/** See following "See Also"
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		return("Node "+this.nodeId+" ("+this.x+","+this.y+")");
	}
}
